package com.thinkingcoder.tcregistry.service;

import java.util.List;
import java.util.Map;

import com.thinkingcoder.tcregistry.model.meta.InstanceMeta;

/**
 * Interface for registry service.
 */
public interface RegistryService {
    // 最基础的三个方法
    // 注册
    InstanceMeta register(String serviceName, InstanceMeta instance);

    // 反注册
    InstanceMeta unregister(String serviceName, InstanceMeta instance);

    // 获取服务所有实例
    List<InstanceMeta> getAllInstances(String serviceName);

    // TODO 添加一些高级功能
    Long renew(InstanceMeta instance, String... serviceNames);

    Long version(String serviceName);

    Map<String, Long> versions(String... serviceNames);

}
